package com.sl.service;

import com.sl.mapper.CompnayBusinessMapper;
import com.sl.pojo.CompnayBusiness;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CompnayBusinessService {
    @Resource
    private CompnayBusinessMapper compnayBusinessMapper;

    ////查询：主键
    public CompnayBusiness findByIdCompnayBusiness(Integer id){
        return compnayBusinessMapper.selectByPrimaryKey(id);
    }
    //查询：所有
    public List<CompnayBusiness> findAllCompnayBusiness(){
        List<CompnayBusiness> compnayBusinessList = compnayBusinessMapper.selectAll();
        return  compnayBusinessList;
    }

    //增加
    public void addCompnayBusiness(CompnayBusiness compnayBusiness){
        compnayBusinessMapper.insertSelective(compnayBusiness);
    }
    //修改
    public void updateCompnayBusiness(CompnayBusiness compnayBusiness){
        compnayBusinessMapper.updateByPrimaryKeySelective(compnayBusiness);
    }

    public void deleteById(CompnayBusiness compnayBusiness) {
        compnayBusinessMapper.deleteByPrimaryKey(compnayBusiness);
    }

}
